home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / comm / maxsgame.lha / MaxGames / Tradewars20.lha / TwMaint < prev    next >
Text File  |  1992-05-17  |  1KB  |  59 lines

  1. /* TwMaint BBSEVENT file -- Written by Chris Cowan */
  2.  
  3. options results
  4. signal on error
  5. signal on syntax
  6. signal on ioerr
  7. path="pfiles:tradewars/universe/"
  8. path2="pfiles:tradewars/messages/"
  9. sector=0;ports=0;fighters=0;fighters2=0;mines=0;beacons=0;planets=0;asteroids=0
  10. transmit "\f1\n2\c4<\c7Scanning sectors\c4>\n2"
  11. sendstring "\c2Sector: \c3"
  12.  
  13. loop:
  14. sector=sector+1
  15. if sector>999 then signal writeit
  16. sendstring sector
  17. if ~exists(path||'tws'||sector) then signal loopend
  18. call open(file,path||'tws'||sector,"R")
  19. do i=1 to 30
  20. sd.i=readln(file)
  21. end
  22. call close file
  23. c=sd.21
  24. b=left(c,1)
  25. if b ~="." then ports=ports+1
  26. if sd.8>0 then do
  27.  if sd.9<90 then fighters=fighters+sd.8
  28.  if sd.9>90 then fighters2=fighters2+sd.8
  29. end
  30. if sd.16>0 then mines=mines+sd.16
  31. if sd.24 ~="" & sd.24 ~="0" then beacons=beacons+1
  32. c=sd.26
  33. b=left(c,1)
  34. if b ~="." then planets=planets+1
  35. if sd.30>0 then asteroids=asteroids+1
  36.  
  37. loopend:
  38. a = "\h1"
  39. if sector > 9 then a = "\h2"
  40. if sector > 99 then a = "\h3"
  41. sendstring a
  42. signal loop
  43.  
  44. writeit:
  45. sendstring "\n2\c6Saving\c7..."
  46. tt.1="\c1-=- Updated on "date()" -=-"
  47. tt.2=""
  48. tt.3="\c3"ports"\c2 ports are open."
  49. tt.4="\c3"planets"\c2 planets & \c3"asteroids"\c2 asteroids exist."
  50. tt.5="\c3"mines"\c2 mines & \c3"beacons"\c2 beacons are in use."
  51. tt.6="\c3"fighters"\c2 player fighters & \c3"fighters2"\c2 alien fighters are guarding sectors."
  52. call open(file,path2||'gamestats',"W")
  53. do i=1 to 6
  54. call writeln file, tt.i
  55. end
  56. call close file
  57. transmit "\h6\c6ed!"
  58. exit
  59.